import { createMemoryHistory, createRouter, createWebHistory } from 'vue-router'


// import User from '@/views/user/index.vue'
// import Layout from '@/views/Layout.vue'
// import Login from '@/views/Login.vue'
// import Index from '@/views/Index.vue'


export const routes = [
    { 
        path: '/', 
        component: ()=> import('@/views/Layout.vue'),
        name: 'layout',
        children:[
            { path: '/',redirect: '/index' },
            { path: '/user', component: ()=>import('@/views/user/index.vue'), name: 'user' },
            { path: '/index', component: ()=>import('@/views/Index.vue'), name: 'index' },           
        ] 
    },
    {
        path: '/login',
        component: ()=>import('@/views/Login.vue'),
        name: 'login'
    }

]

const router = createRouter({
    history: createWebHistory(),
    routes,
})


export default router